﻿namespace gt.webapi.core.Entity.Common
{
    public class Constants
    {
        public const string API_PROPERTY_REQUESTID = "API_PROPERTY_REQUESTID";
        public const string API_PROPERTY_APPKEY = "API_PROPERTY_APPKEY";
        public const string API_PROPERTY_STOPWATCH = "API_PROPERTY_STOPWATCH";

        public const char AUTH_BASIC_PARAM_SPLIT = ':';
        public const string AUTH_BASIC_PARAM_Scheme = "Basic";
        public const string AUTH_BASIC_PARAM_USERNAME = "username";
        public const string AUTH_BASIC_PARAM_PASSWORD = "password";

        public const string ERROR_UNKNOW = "未知错误！";
        public const string ERROR_INVALID_AUTH = "invalid appkey or appsecret";
        public const string ERROR_UNAUTH = "无权限请求！";
        public const string ERROR_FORBIDDEN = "非法请求！";
        public const string ERROR_SYSTEM = "系统错误！";
        public const string ERRPR_RATE = "访问过于频繁，请稍后再试！";

        public const string KEY_WHITEIP = "key_api_whiteIps";
        public const string KEY_AUTHORITY_PREFIX = "key_api_authority_";
        public const string KEY_RATELIMIT_PREFIX = "key_api_ratelimit_";
        public const string KEY_RATELIMIT_PERIOD_PREFIX = "key_api_ratelimit_period_";

        public const string API_CONTENT_MEDIATPE_TEXT = "text/plain";
        public const string API_CONTENT_MEDIATPE_JSON = "application/json";

        public const string AUTHENTICATION_TYPE = "application_webapi";
    }
}
